import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_module/global/colors.dart';
import 'package:flutter_screenutil/screen_util.dart';
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  const MyApp({Key key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        //appBar: AppBar(
        //  backgroundColor: Colors.black26,
        //  title: Text('container'),
        //),
        body: UploadWorkInformation(),
      ),
    );
  }
}
class UploadWorkInformation extends StatefulWidget {
  UploadWorkInformation({Key key}) : super(key: key);

  @override
  _UploadWorkInformationState createState() {
    return _UploadWorkInformationState();
  }
}

class _UploadWorkInformationState extends State<UploadWorkInformation> {
  FocusNode _focusNode = new FocusNode();
  FocusNode _focusNode1 = new FocusNode();
  FocusNode _focusNode2 = new FocusNode();
  FocusNode _focusNode3 = new FocusNode();
  TextEditingController _controller = new TextEditingController();
  TextEditingController _controller1 = new TextEditingController();
  TextEditingController _controller2 = new TextEditingController();
  TextEditingController _controller3 = new TextEditingController();
  @override
  void initState() {
    super.initState();
  }

  @override
  void dispose() {
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    ScreenUtil.init(
      BoxConstraints(
          maxWidth: MediaQuery.of(context).size.width,
          maxHeight: MediaQuery.of(context).size.height
      ),
      designSize: Size(1080,2340),
    );
    return Scaffold(
      backgroundColor:Color(0xff000B1F) ,
      appBar: AppBar(
        backgroundColor: Color(0xff000B1F),
        title: Text(
          '作品信息',
          style:TextStyle(
            color:Colors.white,
          ),
        ),
        centerTitle: true,
        leading: IconButton(
          icon: Icon(Icons.arrow_back,color: Colors.white),
          onPressed: (){
            Navigator.pop(context);
          },
        ),
        actions: [
          InkWell(
            onTap: (){
              EasyLoading.showSuccess('发布成功');
            },
            child: Center(
              child: Text(
                '发布',
                style:TextStyle(
                  fontSize: 17,
                  color:Colors.white70,
                ),
              ),
            ),
          ),
          SizedBox(width: ScreenUtil().setWidth(40),),
        ],
      ),
      body: Container(
        margin: EdgeInsets.fromLTRB(
          ScreenUtil().setWidth(0),
          ScreenUtil().setHeight(0),
          ScreenUtil().setWidth(0),
          ScreenUtil().setWidth(0),
        ),
        padding: EdgeInsets.fromLTRB(
          ScreenUtil().setWidth(30),
          ScreenUtil().setHeight(30),
          ScreenUtil().setWidth(30),
          ScreenUtil().setHeight(0),
        ),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Text(
              '作者信息',
              style:TextStyle(
                fontSize: ScreenUtil().setSp(45),
                color:Colors.white70,
              ),
            ),
            Container(
              margin: EdgeInsets.fromLTRB(
                ScreenUtil().setWidth(0),
                ScreenUtil().setHeight(40),
                ScreenUtil().setWidth(0),
                ScreenUtil().setHeight(0),
              ),
              decoration: BoxDecoration(
                color:Color(0xff182643),
                borderRadius: BorderRadius.all(Radius.circular(5)),
              ),
              padding: EdgeInsets.only(left: ScreenUtil().setWidth(40)),
              //width: ScreenUtil().screenWidth - 100,
              child: TextField(
                focusNode: _focusNode,
                controller: _controller,
                cursorColor: Color(0xff2DCA97),
                decoration: InputDecoration(
                  suffixIcon: IconButton(
                    icon: Icon(
                      Icons.close,
                      color: Color(0xffBEBEBE),
                    ),
                    onPressed: () {
                      _controller.clear();
                    },
                  ),
                  border: OutlineInputBorder(
                    borderRadius: BorderRadius.all(
                        Radius.circular(ScreenUtil().setHeight(20))),
                  ),
                  enabledBorder: UnderlineInputBorder(
                    borderSide: BorderSide(color: Colors.transparent),
                  ),
                  focusedBorder: UnderlineInputBorder(
                    borderSide: BorderSide(color: Colors.transparent),
                  ),
                  hintText: 'siegelion',
                  hintStyle: TextStyle(
                    color: Color(0xffBEBEBE),
                    fontSize: ScreenUtil().setSp(50),
                  ),
                  labelStyle: TextStyle(
                      color: Color(0xffBEBEBE),
                      fontSize: ScreenUtil().setSp(50)),
                ),
              ),
            ),
            Container(
              margin: EdgeInsets.fromLTRB(
                ScreenUtil().setWidth(0),
                ScreenUtil().setHeight(40),
                ScreenUtil().setWidth(0),
                ScreenUtil().setHeight(0),
              ),
              decoration: BoxDecoration(
                color:Color(0xff182643),
                borderRadius: BorderRadius.all(Radius.circular(5)),
              ),
              padding: EdgeInsets.only(left: ScreenUtil().setWidth(40)),
              //width: ScreenUtil().screenWidth - 100,
              child: TextField(
                focusNode: _focusNode1,
                controller: _controller1,
                cursorColor: Color(0xff2DCA97),
                decoration: InputDecoration(
                  suffixIcon: IconButton(
                    icon: Icon(
                      Icons.close,
                      color: Color(0xffBEBEBE),
                    ),
                    onPressed: () {
                      _controller1.clear();
                    },
                  ),
                  border: OutlineInputBorder(
                    borderRadius: BorderRadius.all(
                        Radius.circular(ScreenUtil().setHeight(20))),
                  ),
                  enabledBorder: UnderlineInputBorder(
                    borderSide: BorderSide(color: Colors.transparent),
                  ),
                  focusedBorder: UnderlineInputBorder(
                    borderSide: BorderSide(color: Colors.transparent),
                  ),
                  hintText: '17872138818',
                  hintStyle: TextStyle(
                    color: Color(0xffBEBEBE),
                    fontSize: ScreenUtil().setSp(50),
                  ),
                  labelStyle: TextStyle(
                      color: Color(0xffBEBEBE),
                      fontSize: ScreenUtil().setSp(50)),
                ),
              ),
            ),
            SizedBox(height: ScreenUtil().setHeight(50),),
            Text(
              '作品预售',
              style:TextStyle(
                fontSize: ScreenUtil().setSp(45),
                color:Colors.white70,
              ),
            ),
            Container(
              margin: EdgeInsets.fromLTRB(
                ScreenUtil().setWidth(0),
                ScreenUtil().setHeight(40),
                ScreenUtil().setWidth(0),
                ScreenUtil().setHeight(0),
              ),
              decoration: BoxDecoration(
                color:Color(0xff182643),
                borderRadius: BorderRadius.all(Radius.circular(5)),
              ),
              padding: EdgeInsets.only(left: ScreenUtil().setWidth(40)),
              //width: ScreenUtil().screenWidth - 100,
              child: TextField(
                focusNode: _focusNode2,
                controller: _controller2,
                cursorColor: Color(0xff2DCA97),
                decoration: InputDecoration(
                  suffixIcon: IconButton(
                    icon: Icon(
                      Icons.close,
                      color: Color(0xffBEBEBE),
                    ),
                    onPressed: () {
                      _controller2.clear();
                    },
                  ),
                  border: OutlineInputBorder(
                    borderRadius: BorderRadius.all(
                        Radius.circular(ScreenUtil().setHeight(20))),
                  ),
                  enabledBorder: UnderlineInputBorder(
                    borderSide: BorderSide(color: Colors.transparent),
                  ),
                  focusedBorder: UnderlineInputBorder(
                    borderSide: BorderSide(color: Colors.transparent),
                  ),
                  hintText: '2.45 Eth',
                  hintStyle: TextStyle(
                    color: Color(0xffBEBEBE),
                    fontSize: ScreenUtil().setSp(50),
                  ),
                  labelStyle: TextStyle(
                      color: Color(0xffBEBEBE),
                      fontSize: ScreenUtil().setSp(50)),
                ),
              ),
            ),
            Container(
              margin: EdgeInsets.fromLTRB(
                ScreenUtil().setWidth(0),
                ScreenUtil().setHeight(40),
                ScreenUtil().setWidth(0),
                ScreenUtil().setHeight(0),
              ),
              decoration: BoxDecoration(
                color:Color(0xff182643),
                borderRadius: BorderRadius.all(Radius.circular(5)),
              ),
              padding: EdgeInsets.only(left: ScreenUtil().setWidth(40)),
              //width: ScreenUtil().screenWidth - 100,
              child: TextField(
                focusNode: _focusNode3,
                controller: _controller3,
                cursorColor: Color(0xff2DCA97),
                decoration: InputDecoration(
                  suffixIcon: IconButton(
                    icon: Icon(
                      Icons.close,
                      color: Color(0xffBEBEBE),
                    ),
                    onPressed: () {
                      _controller3.clear();
                    },
                  ),
                  border: OutlineInputBorder(
                    borderRadius: BorderRadius.all(
                        Radius.circular(ScreenUtil().setHeight(20))),
                  ),
                  enabledBorder: UnderlineInputBorder(
                    borderSide: BorderSide(color: Colors.transparent),
                  ),
                  focusedBorder: UnderlineInputBorder(
                    borderSide: BorderSide(color: Colors.transparent),
                  ),
                  hintText: '100',
                  hintStyle: TextStyle(
                    color: Color(0xffBEBEBE),
                    fontSize: ScreenUtil().setSp(50),
                  ),
                  labelStyle: TextStyle(
                      color: Color(0xffBEBEBE),
                      fontSize: ScreenUtil().setSp(50)),
                ),
              ),
            ),
            SizedBox(height: ScreenUtil().setHeight(50),),
            Text(
              '售卖方式: 线上商城',
              style:TextStyle(
                color:Colors.white70,
              ),
            )
          ],
        ),
      ),
    );
  }
}